package com.twq.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.View;
import org.springframework.web.servlet.ViewResolver;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import java.util.Locale;

//全面接管springmvc
@Configuration


//@EnableWebMvc
public class MyMvcConfig implements WebMvcConfigurer {
//    @Bean
//    public ViewResolver MyViewResolver(){
//        return new MyViewResolver();
//    }
//
//
//
//    public static class MyViewResolver implements ViewResolver {
//        @Override
//        public View resolveViewName(String s, Locale locale) throws Exception {
//            return null;
//        }
//    }

    @Override
//    视图跳转
    public void addViewControllers(ViewControllerRegistry registry) {
        registry.addViewController("/twq").setViewName("test");
    }

}
